import { createRouter, createWebHashHistory } from 'vue-router'

const routes = [
  {
    path: '/',
    name: 'Home',
    component: () => import('../views/Home.vue'),
    meta: { title: '书架' }
  },
  {
    path: '/search',
    name: 'Search',
    component: () => import('../views/Search.vue'),
    meta: { title: '搜索' }
  },
  {
    path: '/reader',
    name: 'Reader',
    component: () => import('../views/Reader.vue'),
    meta: { title: '阅读' }
  },
  {
    path: '/download',
    name: 'Download',
    component: () => import('../views/Download.vue'),
    meta: { title: '下载管理' }
  },
  {
    path: '/settings',
    name: 'Settings',
    component: () => import('../views/Settings.vue'),
    meta: { title: '设置' }
  },
  {
    path: '/source-manager',
    name: 'SourceManager',
    component: () => import('../views/SourceManager.vue'),
    meta: { title: '书源管理' }
  }
]

const router = createRouter({
  history: createWebHashHistory(),
  routes
})

export default router